import { InjectionKey } from 'vue'
import { createStore, Store } from 'vuex'
import user from "./modules/user"
import {UserInfo } from '../type/index'


// 创建一个新的 store 实例
const store = createStore({
  state() {
    return {
      searchContent:"",
      isSearch:false,
      isArticles:false,
      isMy:false
    };
  },
  mutations: {
    setSeaContent(state, newCon) {
      state.searchContent=newCon
    },
    setIsSearch(state,newVal){
      state.isSearch=newVal
    },
    setIsAritcles(state,newVal){
      state.isArticles=newVal
    },
    setIsMy(state,newVal){
      state.isMy=newVal
    },
  },
  modules: {
    user,
  },
});

export default store;

// export const store = createStore<State>({
//   state() {
//     return {
//       count: 0,

//     }
//   },
//   modules: {
//     user
//   },
//   mutations: {
//     increment(state) {
//       state.count++
//     }
//   }
// })
